<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改账户')" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-account-edit" th:object="${finAccount}">
            <input name="accountId" th:field="*{accountId}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">用户信息：</label>
                    <div class="col-sm-8">
                        <span th:text="${userString}"></span>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">账户名称：</label>
                    <div class="col-sm-8">
                        <input name="accountName" th:field="*{accountName}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">账户类型：</label>
                    <div class="col-sm-8">
                        <select name="accountType" class="form-control" th:with="type=${@dict.getType('fin_account_type')}" required>
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{accountType}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">银行名称：</label>
                    <div class="col-sm-8">
                        <input name="bankName" th:field="*{bankName}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">银行账号：</label>
                    <div class="col-sm-8">
                        <input name="accountNum" th:field="*{accountNum}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">账户余额：</label>
                    <div class="col-sm-8">
                        <input name="balance" th:field="*{balance}" class="form-control" type="text">
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var prefix = ctx + "pims/account";
        $("#form-account-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-account-edit').serialize());
            }
        }
    </script>
</body>
</html>